﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    public partial class numberpool_WH : FormBase1
    {
        public numberpool_WH()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            gridControl1.DataSource = my.bw.View_numphone_Full_List(lue_Combo.Text, te_phone.Text, te_cno.Text, radioGroup1.Text, my.ACID);
        }

        private void numberpool_Load(object sender, EventArgs e)
        {
            lue_Combo.Properties.DataSource = my.bw.View_Combo_lite_List("", my.ACID);
            lue_Combo.Properties.DisplayMember = "ComboName";
            lue_Combo.Properties.ValueMember = "ComboName";
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            lue_Combo.EditValue = null;
            te_cno.Text = "";
            te_phone.Text = "";
            radioGroup1.EditValue = null;
        }

        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            if (e.RowHandle>=0)
            {
                SVC.client.numberpool num = gridView1.GetRow(e.RowHandle) as SVC.client.numberpool;
                if (e.Button == MouseButtons.Left && e.Clicks == 2)
                {
                    Comm.openDialogForm("UI.Forms.numphoneDetail", num);
                }
            }

        }

        private void btn_stop_Click(object sender, EventArgs e)
        {
            SVC.client.View_numphone_Full vnf = gridView1.GetRow(gridView1.FocusedRowHandle) as SVC.client.View_numphone_Full;
            if (vnf!=null)
            {
                CardWH frm = new CardWH(vnf.号码, null);
                frm.ShowDialog();
            }
        }














    }
}